<template>
  <div class="con">
    <div class="div">
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <!-- :to="{ path: '/' }" -->
        <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item :to="{ path: '/home/notice' }"
          >公告信息</el-breadcrumb-item
        >
        <el-breadcrumb-item class="dangqian">公告详情</el-breadcrumb-item>
      </el-breadcrumb>
      <div class="gonggao">
        <div class="one">{{detail.name}}</div>
        <div class="two">
          <span>来源：{{detail.source}}</span>
          <span>作者：{{detail.auther}}</span>
          <span>发布时间：{{detail.caAt?detail.caAt.substring(0,10):''}}</span>
        </div>
        <div class="sw">
          摘要：{{detail.title}}
        </div>
        <div v-html="detail.content"></div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "",
  data() {
    return {
      html: "<p>123</p>",
      detail:{}
    };
  },
  //注册组件
  components: {},
  //生命周期 - 创建完成（访问当前this实例）
  created() {
    this.isinput();
    if(this.$route.query.id){
      this.getdetail()
    }
  },
  //生命周期 - 挂载完成（访问DOM元素）
  mounted() {},
  //计算属性
  computed: {},
  //方法
  methods: {
    getdetail(){
      this.$postRequest('/api/mallNews/getNewsInfo',{
        newsId: this.$route.query.id
      }).then(res=>{
        this.detail=res.data
      })
    },
    isinput() {
      this.$store.commit("setDValue", false);
    }
  }
};
</script>
<style scoped lang="scss">
.con {
  background-color: #f9f9f9;
  .div {
    width: 1400px;
    margin: auto;
    /deep/ .el-breadcrumb {
      height: 48px;
      font-size: 14px;
      line-height: 48px;
      .el-breadcrumb__inner {
        color: #999;
        font-weight: 500;
      }
      .dangqian .el-breadcrumb__inner {
        color: #1a69e0;
      }
    }
    .gonggao {
      width: 100%;
      background: #ffffff;
      border: 1px solid #eeeeee;
      padding: 30px;
      .one {
        font-size: 24px;
        font-family: PingFang SC;
        font-weight: 500;
        color: #000000;
        margin-bottom: 20px;
      }
      .two {
        font-size: 14px;
        font-family: PingFang SC;
        font-weight: 500;
        color: #666666;
        span {
          margin-right: 20px;
        }
      }
      .sw {
        font-size: 16px;
        font-family: PingFang SC;
        font-weight: 500;
        color: #000000;
        margin: 16px 0 18px;
        line-height: 20px;
      }
    }
  }
}
</style>